<html lang="en">
<!--<![endif]-->

<head>
  <meta charset="UTF-8">
  <meta http-equiv="Access-Control-Allow-Origin" content="*">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>注册</title>
  <!-- title前面的图标 -->
  <link rel="shortcut icon" type="image/x-icon" href="public/images/huobi.png" />
  <!-- css文件 -->
  <link rel="stylesheet" href="public/css/login.css">
  <link href="public/css/index.css" rel="stylesheet">
  <link href="public/css/request.css" rel="stylesheet">
  <link rel="stylesheet" href="public/css/doctype.css" />
  <!-- js文件 -->
  <script src="public/js/script.js"></script>
  <script src="public/js/hc_enduser.js"></script>
  <script src="public/js/snippet.js"></script>
  <script src="public/js/doctype.js"></script>
  <script src="public/js/jquery.min.js"></script>
  <script>
    (function () {
      var targetOrigin = "index.html";
      new App({
        targetOrigin: targetOrigin
      });
    }).call();
  </script>
</head>

<body dir="">
  <div class="modal">
    <h2 class="title">注册 Huobi</h2>
    <!-- <form id="register" class="box box_form" >
      <input name="utf8"  type="hidden" value=""><input type="hidden" name="authenticity_token"
        value=""> -->
    <p>请填写此表格，我们将向您发送一封欢迎电邮，使您可验证电邮地址并登录。</p>
    <fieldset>
      <!-- <input type="hidden" name="" id="return_to_on_failure" value="">
        <input type="hidden" name="" id="return_to" value=""> -->

      <label for="user_name">全名 <super>*</super></label>
      <input type="text" name="Uname" id="Uname">

      <label for="user_password">密码 <super>*</super></label>
      <input type="password" name="password" id="password">

      <label for="user_email">电邮地址 <super>*</super></label>
      <input type="email" name="Email" id="Email">

      <!-- <input type="hidden" name="brand_id" id="brand_id" value="114095082532">
        <input type="hidden" name="auth_origin" id="auth_origin" value="114095082532,false,true">
        <input type="hidden" name="timezone_name" id="timezone_name" value="Asia/Shanghai"> -->
      <div id="recaptcha_widget">
        <!-- 人机验证 -->
        <!-- <div data-sitekey="6LdPNyITAAAAAG9bN96aLeu11VRFZ7m6HaFBRGf1" data-theme="light" class="g-recaptcha "
            public_key="6LdPNyITAAAAAG9bN96aLeu11VRFZ7m6HaFBRGf1" ajax="true" width="100%">
            <div style="width: 304px; height: 78px;">
              <div><iframe
                  src="https://www.recaptcha.net:443/recaptcha/api2/anchor?ar=1&amp;k=6LdPNyITAAAAAG9bN96aLeu11VRFZ7m6HaFBRGf1&amp;co=aHR0cHM6Ly9odW9iaWdsb2JhbC56ZW5kZXNrLmNvbTo0NDM.&amp;hl=zh-CN&amp;v=v1560753160450&amp;theme=light&amp;size=normal&amp;cb=3gwvj7bjg0a4"
                  width="304" height="78" role="presentation" name="a-r2d6vhklmiox" frameborder="0" scrolling="no"
                  sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups-to-escape-sandbox"></iframe>
              </div><textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response"
                style="width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px; resize: none; display: none;"></textarea>
            </div>
          </div> -->
      </div>
    </fieldset>
    <div class="controls">
      <input type="submit" name="commit" id="regiser" value="注册" class="button primary">
      <a href="login.html">取消</a>
    </div>
    <!-- <script>
      //<![CDATA[
      var tz = jstz.determine();
      document.getElementById("timezone_name").value = tz.name();
      //]]>
    </script> -->
  </div>
  <!-- <div
    style="background-color: rgb(255, 255, 255); border: 1px solid rgb(204, 204, 204); box-shadow: rgba(0, 0, 0, 0.2) 2px 2px 3px; position: absolute; transition: visibility 0s linear 0.3s, opacity 0.3s linear 0s; opacity: 0; visibility: hidden; z-index: 2000000000; left: 852.5px; top: -10000px;">
    <div
      style="width: 100%; height: 100%; position: fixed; top: 0px; left: 0px; z-index: 2000000000; background-color: rgb(255, 255, 255); opacity: 0.05;">
    </div>
    <div class="g-recaptcha-bubble-arrow"
      style="border-width: 11px; border-style: solid; border-color: transparent rgb(204, 204, 204) transparent transparent; border-image: initial; width: 0px; height: 0px; position: absolute; pointer-events: none; margin-top: -11px; z-index: 2000000000; top: 290px; right: 100%;">
    </div>
    <div class="g-recaptcha-bubble-arrow"
      style="border-width: 10px; border-style: solid; border-color: transparent rgb(255, 255, 255) transparent transparent; border-image: initial; width: 0px; height: 0px; position: absolute; pointer-events: none; margin-top: -10px; z-index: 2000000000; top: 290px; right: 100%;">
    </div>
    <div style="z-index: 2000000000; position: relative; width: 400px; height: 580px;"><iframe title="recaptcha 验证"
        src="https://www.recaptcha.net:443/recaptcha/api2/bframe?hl=zh-CN&amp;v=v1560753160450&amp;k=6LdPNyITAAAAAG9bN96aLeu11VRFZ7m6HaFBRGf1&amp;cb=5awgcn58yu8o"
        name="c-r2d6vhklmiox" frameborder="0" scrolling="no"
        sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups-to-escape-sandbox"
        style="width: 400px; height: 580px;"></iframe></div>
  </div> -->
  <script type="text/javascript">
    //注册
    $("#regiser").click(function () {
      var Uname = $("#Uname").value; //全名
      var password = $("#password").value; //密码
      var Email = $("#Email").value;
      var emailReg = /^\w+@\w+(\.[a-zA-Z]{2,3}){1,2}$/; //邮箱验证
      if (Uname == "") {
        alert("请输入全名!");
        return false;
      } else if (password == "") {
        alert("请输入密码!");
        return false;
      } else if (Email == "") {
        alert("请输入邮箱!");
        return false;
      } else if (!emailReg.test(Email)) {
        alert("请输入正确的邮箱格式!")
        return false;
      } else {
        var filed = {
          Uname: $("input[name='Uname']").val(),
          Upwd: $("input[name='password']").val(),
          Email: $("input[name='Email']").val()
        };
        $.ajax({
          type: "Post",
          contentType: "application/json; charset=utf-8",
          url: "http://192.168.137.1:5001/api/values/Register",
          dataType: 'Json',
          data: JSON.stringify(filed),
          // async: true,
          success: function (result) {
            datas: result
            alert(result);
            window.location.href = "doctype.html"
          },
          error: function (result) {
            alert("注册失败");
          }
        });
      }
    })
  </script>
</body>

</html>